package com.sc.nft.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.vo.ecology.AdminEcologyReforgeUserRecordsVO;
import com.sc.nft.entity.vo.ecology.AdminEcologyReforgeUserRecordsVO;
import com.sc.nft.entity.vo.ecology.ExpendEcologyReforgeRecordsVO;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.UserEcologyReforgeRecords;
import com.sc.nft.mapper.UserEcologyReforgeRecordsMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 生态-重铸-用户记录表(sc_user_ecology_reforge_records)数据DAO
 *
 * @author Sun
 * @since 2024-06-15 11:02:57
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class UserEcologyReforgeRecordsDao extends ServiceImpl<UserEcologyReforgeRecordsMapper, UserEcologyReforgeRecords> {

    public Page<ExpendEcologyReforgeRecordsVO> expendRecords(Long userId, Integer pageNo, Integer pageSize) {
        return baseMapper.expendRecords(new Page<>(pageNo, pageSize), userId);
    }

    public BigDecimal getSumEcologyHatchReforgeTotalFuelConsumed() {
        return baseMapper.getSumEcologyHatchReforgeTotalFuelConsumed();
    }

    public BigDecimal getYesterDaySumEcologyPoints() {
        return baseMapper.getYesterDaySumEcologyPoints();
    }

    public BigDecimal getFoundryFuelConsumptionByStartTimeAndEndTime(Date startTime, Date endTime) {
        return baseMapper.getFoundryFuelConsumptionByStartTimeAndEndTime(startTime, endTime);
    }

    public Page<AdminEcologyReforgeUserRecordsVO> getPageUserRecordsRecords(Long collectionId, Long userId, String startTime, String endTime, Integer pageNo, Integer pageSize) {
        return baseMapper.getPageUserRecordsRecords(new Page<>(pageNo, pageSize), collectionId, userId, startTime, endTime);
    }

    public List<AdminEcologyReforgeUserRecordsVO> getPageUserRecordsExport(Long collectionId, Long userId, String startTime, String endTime) {
        return baseMapper.getPageUserRecordsExport(collectionId, userId, startTime, endTime);
    }

    public List<ExpendEcologyReforgeRecordsVO> expendRecordsDetails(Long userId, Long id) {
        return baseMapper.expendRecordsDetails(userId, id);
    }
}